<!--************************************************************ -->
<!--* 文件创建日期：2010                                  * -->
<!--* 文件修改日期：			                                   * -->
<!--************************************************************ -->
<!--JSP初始化设置-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.infomanage.po.*" %>
<%@page import="com.infomanage.vo.*" %>
<%@page import="com.infomanage.service.tech.*"%>
<%  response.addDateHeader("Expires", 0);response.setHeader("Pragma","no-cache"); response.setHeader("Cache-Control","no-cache");%>
<%
	request.setCharacterEncoding("UTF-8");
	String itemId = request.getParameter("itemId");
    if(itemId == null) itemId = "";
    
    TechCheckItem item = TechCheckService.loadTechCheck(request, response, out);
    int personId = -1;
    int deptId = -1;
    String personName = "";
    String deptName = "";
    String description = "";
    String firstMonthScore = "";
    String lastMonthScore = "";
    String secondMonthScore = "";
    String totalScore = "";
    String firstMonth = "";
    String secondMonth = "";
    String lastMonth = "";
    
    if(item != null) {
    	TechCheck bean = item.getBean();
		Department dept = item.getDept();
		Person person = item.getPerson();
	    personId = person.getPersonId();
	    deptId = bean.getDeptId();
	    personName = person.getName();
	    deptName = dept.getPath();
	    description = bean.getDescription();
	    firstMonthScore = bean.getFirstMonthScore();
	    lastMonthScore = bean.getLastMonthScore();
	    secondMonthScore = bean.getSecondMonthScore();
	    totalScore = bean.getTotalScore();
	    firstMonth = bean.getFirstMonth();
	    secondMonth = bean.getSecondMonth();
	    lastMonth = bean.getLastMonth();
    } 
%>
<html>
<head>
	<title>月(季)考核记录</title>
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">	
	<link href="../../css/table.css" rel="stylesheet" type="text/css">
	<link href="../../css/calendar.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="../../js/calendar.js"></script>
	<script type="text/javascript" src="../../js/common.js"></script>
	<script type="text/javascript">
	   function init() {
		   if("" != "<%=itemId%>") { // 修改
		   		form1.firstMonth.value = "<%=firstMonth%>";
		   		form1.secondMonth.value = "<%=secondMonth%>";
		   		form1.lastMonth.value = "<%=lastMonth%>";
		   }
	   }
	   // 提交
	   function doSubmit(){
	   		if(validate()){
	   			return;
	   		}
		 	if("" == "<%=itemId%>") {
		 		form1.actionType.value = "add";
			}else {
		 		form1.actionType.value = "modify";
			}
		 	form1.submit();
	   }

	   function showError(error){
		   alert(error);
	   }

	   function showInfo(info){
		   alert(info);
		   window.returnValue = "ok";
		   window.close();
	   }
	   
	   function validate(){
	   		if(form1.deptId.value == -1){
	   			alert("队别不能为空！");
	   			return true;
	   		}
	   		if(form1.personId.value == -1){
	   			alert("姓名不能为空！");
	   			return true;
	   		}
	   			   	    
	   		if(form1.description.value.length > 5000){
   				alert("备注不能超过5000个字！");
   				return true;
	   	    }
	   		return false;
	   }
	</script>
</head>
<body  rightmargin="0" bottommargin="0" leftmargin="0" topmargin="0" onclick="clickBody();" onload="init();">
	<form name="form1" action="check_action.jsp" method="post" target="actionFrame">
	<input type="hidden" name="itemId" value="<%=itemId%>">
	<input type="hidden" name="actionType">
	<table class="dialogTable" cellpadding="0" cellspacing="0">
		<!-- 表头-->
		<tr class="dialogTableHeader">
			<td>月(季)考核记录</td>
		</tr>
		<!-- 表数据-->
		<tr class="dialogTableContent">
			<td>
				<!-- 数据项 -->
				<table class="dataTable">
					<col width="18%">
					<col width="34%">
					<col width="13%">
					<col width="35%">
					<tr>
						<td class="field">
							队别
						</td>
						<td>
							<span class="treeSpan" onclick="showTree(this, '../common/deptTree.jsp');" treeSelect="true" treeType="1">
								<input name="deptName" nodeId="" id="deptTreeInput" value="<%=deptName %>" 
									style="width: 181px;" readonly="readonly" 
									treeSelect="true"><input name="deptId" value="<%=deptId %>" type="hidden">
							</span>
						</td>
						<td class="field">
							姓名
						</td>
						<td>
							<span class="treeSpan" onclick="showTree(this, '../common/personTree.jsp');" treeSelect="true" treeType="1">
								<input name="personName" nodeId="" id="deptTreeInput" value="<%=personName %>" 
									style="width: 187px;" readonly="readonly" 
									treeSelect="true"><input name="personId" value="<%=personId %>" type="hidden">
							</span>
						</td>
					</tr>
				</table>
				<table class="dataTable2">
					<col width="18%">
					<col width="12%">
					<col width="30%">
					<col width="40%">
					<tr>
						<td class="field" rowspan="3">
							月考核综合得分
						</td>
						<td class="field">
							月份
						</td>
						<td>
							<select name="firstMonth" style="width: 100%">
								<%
									for(int i = 1; i < 13; i++){
								%>
								<option value="<%=i %>"><%=i + "月" %></option>
								<%		
									}
								%>
							</select>
						</td>
						<td>
							<input value="<%=firstMonthScore %>" type="text" style="width: 100%" name="firstMonthScore">
						</td>	
					</tr>
					<tr>
						<td class="field">
							月份
						</td>
						<td>
							<select name="secondMonth" style="width: 100%">
								<%
									for(int i = 1; i < 13; i++){
								%>
								<option value="<%=i %>"><%=i + "月" %></option>
								<%		
									}
								%>
							</select>
						</td>
						<td>
							<input value="<%=secondMonthScore %>" type="text" style="width: 100%" name="secondMonthScore">
						</td>	
					</tr>
					<tr>
						<td class="field">
							月份
						</td>
						<td>
							<select name="lastMonth" style="width: 100%">
								<%
									for(int i = 1; i < 13; i++){
								%>
								<option value="<%=i %>"><%=i + "月" %></option>
								<%		
									}
								%>
							</select>
						</td>
						<td>
							<input value="<%=lastMonthScore %>" type="text" style="width: 100%" name="lastMonthScore">
						</td>	
					</tr>
					<tr>
						<td class="field">
							季度考核综合得分
						</td>
						<td colspan="3">
							<input value="<%=totalScore %>" type="text" style="width: 100%" name="totalScore">
						</td>
					</tr>
					<tr>
						<td class="field">
							备注
						</td>
						<td colspan="3" height="80px">
							<textarea style="width: 100%;height: 100%;" name="description"><%=description %></textarea>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="tableBtn">
				<span onclick="doSubmit();">确定</span>
				<span onclick="window.close();">取消</span>
			</td>
		</tr>
		<tr valign="top">
			<td colspan="2">
				&nbsp;
			</td>
		</tr>
	</table>
	</form>
	<iframe src="#" frameborder="0" id="treeFrame" name="frame" style="display: none;position: absolute;"></iframe>
	<iframe src="#" name="actionFrame" style="display: none;"></iframe>
</body>
</html>